<?php
include('top.php');
require_once('pasmy/dbwaarden.php');
/*echo "dbhost = $dbhost<br>";*/
echo "<br><br>";
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);
$jaar = date("Y");
if(isset($_POST["vervangen"])){
	$dtbsnaam = "vnzvrn" . $_POST["jaardb"];
	$tevervangen = $_POST["tevervangen"];
	$vervangendoor = $_POST["vervangendoor"];
	$veld = $_POST["veld"];
	echo "<h2><div style='text-align: center'><b>In de database $dtbsnaam zal het record $tevervangen vervangen worden door $vervangendoor in het veld $veld</b></div></h2><br>";
	$sql = "update $dtbsnaam set $veld = '$vervangendoor' where $veld = '$tevervangen'";
	echo "<div style='text-align: center'><br><strong>SQL = $sql</strong><br></div>";
	$res = mysql_query($sql, $mysql_id);
	fout($mysql_id);
	
	
}
else {
?>
<font size="6"><strong><div style="text-align: center">Massupdate Database</div></strong></font>
<br /><br /><br />
<form action="massupdate.php" method="post">
<table align="center" border="1" cellpadding="10">
<tr>
<td colspan="2">
<input type="radio" name="veld" value="client" checked="checked" /><b>Klant</b><br>
<input type="radio" name="veld" value="expediteur" /><b>Afzender</b><br>
<input type="radio" name="veld" value="bestemmeling" /><b>Geadresseerde</b><br>
<input type="radio" name="veld" value="plaats" /><b>Losplaats</b><br>
<input type="radio" name="veld" value="driver" /><b>Chauffeur</b><br>
<input type="radio" name="veld" value="laadplaats" /><b>Laadplaats</b><br>
<input type="radio" name="veld" value="nrpl" /><b>Camion</b><br>
</td>
</tr>
<tr>
<td><strong>Database Vanzeveren jaar</strong></td><td><strong><input type="text" name="jaardb" value="<?php echo $jaar;?>"/></strong></td></tr>
<tr>
<td><strong>Te vervangen record</strong></td><td><strong><input type="text" name="tevervangen" /></strong></td>
</tr>
<tr>
<td><strong>Vervangen door</strong></td><td><strong><input type="text" name="vervangendoor" /></strong></td>
</tr>
<tr>
<td colspan="2"><div style="text-align: center"><br /><input type="submit" name="vervangen" value="Vervangen" /></div><br /></td>
</tr>
</table>


</form>
<?php
}
?>